function isFull = positionFull(rankings,pIndx,roster,results,playerIndx,KDST_last)

    isFull = 1;
    RB = 1;
    QB = 2;
    WR = 3;
    TE = 4;
    K = 5;
    DST = 6;
    RWR = 7;
    B = 8;

    pPos = rankings.pos(pIndx); 
    myTeam = results(:,playerIndx);
    round = sum(myTeam > 0) + 1;
    
    if KDST_last 
        if round < length(myTeam) - 1
            if pPos == K || pPos == DST
                return;
            end
        else
            if pPos ~= K && pPos ~= DST
                return;
            end
        end
    end
    
    rostCount = zeros(1,10);
    teamCount = zeros(1,10);
    for i=1:length(roster)
        rostCount(roster(i)) = rostCount(roster(i)) + 1;
    end
    
    for i=1:length(myTeam)
        if myTeam(i) > 0
            teamCount(rankings.pos(myTeam(i))) = teamCount(rankings.pos(myTeam(i))) + 1;
        end
    end
    
    if teamCount(pPos) < rostCount(pPos)
        isFull = 0;
        return;
    end
    
    if pPos == RB || pPos == WR
        RWRcount = teamCount(pPos);
        if RWRcount < rostCount(pPos) + rostCount(RWR)
            isFull = 0;
            return;
        end
    end
    
%     if pPos == RB || pPos == WR
%         RWRcount = teamCount(RB) + teamCount(WR);
%         if RWRcount < (rostCount(RB) + rostCount(WR) + rostCount(RWR))
%             isFull = 0;
%             return;
%         end
%     end
    
    if teamCount(QB) >= rostCount(QB) && teamCount(RB) >= rostCount(RB) ...
            && teamCount(WR) >= rostCount(WR) && teamCount(TE) >= rostCount(TE) && ...
            ((teamCount(RB) + teamCount(WR)) > (rostCount(RB) + rostCount(WR) + rostCount(RWR)))
        isFull = 0;
        
        %MAX ALLOWED ON TEAM
        if pPos == QB && teamCount(QB) >= rankings.MAX_QB
            isFull = 1;
            return;
        end
        if pPos == TE && teamCount(TE) >= rankings.MAX_TE
            isFull = 1;
            return;
        end
        if pPos == K && teamCount(K) >= rankings.MAX_K
            isFull = 1;
            return;
        end
        if pPos == DST && teamCount(DST) >= rankings.MAX_DST
            isFull = 1;
            return;
        end
        
    end
        
    
end